package com.shijie.newvideo;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import androidx.fragment.app.Fragment;

public abstract class BaseFragment extends Fragment {
    public View mview;
    public Context context;
    public Context mContext;
    public Window window;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.context = getActivity();
        this.mContext = getActivity();

    }

    //设置界面对应的view对象
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mview = initView();
        return mview;
    }

    //填充数据的操作，
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        //拿数据去填充UI
        initData();
    }

    //预设UI方法
    public abstract View initView();

    //数据填充UI的方法
    public abstract void initData();

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onResume() {
        super.onResume();
        //初始化分析跟踪
    }

}
